home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / COMM / RPL60 / RPLHELP.INC < prev    next >
Text File  |  1992-12-31  |  5KB  |  114 lines

  1.  
  2.   procedure WriteHelp;
  3.     {-Wr a series of help screens}
  4.   var
  5.     c              : Char;
  6.   begin
  7.     HiVid;
  8.     WrL(Copyright);
  9.     WrL(Version);
  10.     WrL('');
  11.     WrL('');
  12.     WrL('Usage: RPL [-F CommandFile] [options] [input/output redirection]');
  13.     WrL(''); LoVid;
  14.     WrL('  Entering RPL by itself will start an interactive prompting session.');
  15.     WrL('  RPL  uses  standard input and output.  The "-F CommandFile"  option');
  16.     WrL('  reads the first line of a text file and interprets it as a  command');
  17.     WrL('  line.  CommandFile  can  be located anywhere on the PATH,  and  may');
  18.     WrL('  contain nested "-F" commands.  Default extension of CommandFile  is');
  19.     WrL('  ".PAT". The max length of any text line used by RPL is 1024 characters.');
  20.     WrL('  The max length of any command file line is 255 characters.');
  21.     WrL(''); HiVid;
  22.     WrL('Options: ');
  23.     WrL(''); LoVid;
  24.     WrL('  -S  select     Use only lines from InputFile that match "select" pattern.');
  25.     WrL('  -V  select     Use only lines from InputFile that do NOT match "select".');
  26.     WrL('  -M  match      Match criteria applied to selected lines.');
  27.     WrL('  -R  replace    Replacement criteria within matched and selected lines.');
  28.     WrL('  -US            Output "un-selected" lines (no meaning if -S or -V not used).');
  29.     WrL('  -OM            Output only "modified" lines (no meaning if -R not used).');
  30.     WrL('  -OC            Output ONLY a count of selected and matched lines.');
  31.     WrL('  -N             Attach the line number to start of each output line.');
  32.     WrL('  -I             Ignore case (text converted to uppercase within RPL).');
  33.     WrL(''); HiVid;
  34.     WrL('Press any key to view next help page (Q to quit)....');
  35.     c := ReadKey;
  36.     if UpCaseMac(c) = 'Q' then Halt;
  37.     WrL('"Select" and "Match" Regular Expressions (RE for short):');
  38.     WrL(''); LoVid;
  39.     WrL('  Regular  expressions  are combinations of normal  text  characters,');
  40.     WrL('  special   characters   and  the  following   operators.');
  41.     WrL(''); HiVid;
  42.     WrL('  ?      single char                ^      beginning of line ');
  43.     WrL('  $      end of line                *      closure (0 or more times) ');
  44.     WrL('  +      closure (1 or more times)  !      closure (0 or 1 time) ');
  45.     WrL('  [ccl]  character class            [^ccl] negated character class ');
  46.     WrL('  \      escape                     -      range indicator in ccl ');
  47.     WrL('  (RE)   group of RE''s              (RE)(RE) concatenated RE''s ');
  48.     WrL('  RE#RE  alternation                {RE}   define tag match ');
  49.     WrL(''); LoVid;
  50.     WrL('  To  obtain a literal match of any of these characters,  it must  be');
  51.     WrL('  preceded by an escape character (e.g., literal backslash = \\).');
  52.     WrL(''); HiVid;
  53.     WrL('"Replace" Regular Expressions:');
  54.     WrL(''); LoVid;
  55.     WrL('  Replaced  text  includes  the  leading  unmatched  text,  then  the');
  56.     WrL('  replaced version of the matched text, then the trailing unmatched.');
  57.     WrL(''); HiVid;
  58.     WrL('  &     all of match                \n     tagged match n (0<n<10) ');
  59.     WrL('');
  60.     WrL('Press any key to view next help page (Q to quit)....');
  61.     c := ReadKey;
  62.     if UpCaseMac(c) = 'Q' then Halt;
  63.     WrL('');
  64.     WrL('');
  65.     WrL('Special Characters:');
  66.     WrL(''); LoVid;
  67.     WrL('  Expressions  on  the  command line or in a  command  file  may  not');
  68.     WrL('  contain blank space. The following special characters may be');
  69.     WrL('  used in either match or replace expressions, and also within');
  70.     WrL('  character class definitions.');
  71.     WrL(''); HiVid;
  72.     WrL('  \s   space               \t   tab               \b   backspace ');
  73.     WrL('  \r   return              \l   linefeed');
  74.     WrL('  \i   input redir (<)     \o   output redir (>)  \p   pipe (|)');
  75.     WrL('');
  76.     WrL('Extra Special Characters:');
  77.     WrL(''); LoVid;
  78.     WrL('  The following may not be used inside of character class');
  79.     WrL('  definitions.');
  80.     WrL(''); HiVid;
  81.     WrL('  \w word delimiter = [\t\s!"&()*+,-./:;<=>?@[\]^`{|}~]');
  82.     WrL('  \h hex character  = [0-9A-F]');
  83.     WrL('  \z creates a null expression (use by itself)');
  84.     WrL('  \n newline (CR followed by LF)');
  85.     WrL('');
  86.     WrL('Press any key to view next help page (Q to quit)....');
  87.     c := ReadKey;
  88.     if UpCaseMac(c) = 'Q' then Halt;
  89.     WrL('');
  90.     WrL('Examples:');
  91.     WrL('');
  92.     WrL('  RPL -M ^{?+[^\s]}\s* -R \1 <myfile.txt >myfile.cln');
  93.     WrL(''); LoVid;
  94.     WrL('    Strips trailing blanks from myfile.txt (output to myfile.cln).');
  95.     WrL(''); HiVid;
  96.     WrL('  RPL -I -M \w*{[''$#%A-Z0-9]+}\w* -R \1\n <\pathname\file1 >file2');
  97.     WrL(''); LoVid;
  98.     WrL('    Strips word delimiters and puts one word per line.');
  99.     WrL(''); HiVid;
  100.     WrL('  RPL -N -M ^\s*(PROCEDURE)#(FUNCTION) myfile.pas');
  101.     WrL(''); LoVid;
  102.     WrL('    Lists all Pascal Proc/Fn declarations preceded by line number.');
  103.     WrL(''); HiVid;
  104.     WrL('  RPL -F rmblines myfile.txt >myfile.cln');
  105.     WrL(''); LoVid;
  106.     WrL('    Calls the command file RMBLINES.PAT to remove all blank lines.');
  107.     WrL(''); HiVid;
  108.     WrL('  RPL -M ? -OC longfile.pas');
  109.     WrL(''); LoVid;
  110.     WrL('    Counts the number of non-empty lines in longfile.pas.');
  111.     WrL('');
  112.     Halt;
  113.   end;                            {writehelp}
  114.